public class Main {
    public static void main(String[] args) {
        System.out.println(fac(1729));
    }
    public static int fac(int n){
        if(n==0){
            return 0;
        }
        fac(n / 10);
        return n%10 + fac(n/10);
    }
}